#include <stdio.h>
int main()
{
    int h_man;
    int sum_high = 0,ans=0;
    int high[10];
    for (int i = 0; i < 10; i++)
        scanf("%d", &high[i]);
    scanf("%d", &h_man);
    for (int i = 0; i < 10; i++)
        for (int j = 0; j < 9; j++)
        {
            if (high[j] > high[j + 1])
            {
                int temp;
                temp = high[j];
                high[j] = high[j + 1];
                high[j + 1] = temp;
            }
        }
    sum_high = h_man +30;
    for (int i = 9; i >= 0; i--)
    {
        if (sum_high >=high[i])
        {
          ans = i+1;
          break;
        }
    }
    printf("%d\n", ans);

    return 0;
}